Skip to main content

ViewPageBase<TModel>

Assembly: ServiceStack.Razor.dll
View Source
Declaration
public abstract class ViewPageBase<TModel> : RenderingPage, IHasModel

Properties

Layout

View Source
Declaration
public string Layout { get; set; }

Model

View Source
Declaration
public TModel Model { get; set; }

ModelType

View Source
Declaration
public abstract Type ModelType { get; }

ViewEngine

View Source
Declaration
public virtual IViewEngine ViewEngine { get; set; }

AppHost

View Source
Declaration
public IAppHost AppHost { get; set; }

DebugMode

View Source
Declaration
public bool DebugMode { get; }

AppSettings

View Source
Declaration
public IAppSettings AppSettings { get; }

Gateway

View Source
Declaration
public virtual IServiceGateway Gateway { get; }

IsError

View Source
Declaration
public bool IsError { get; }

ModelError

View Source
Declaration
public object ModelError { get; set; }

PathBase

View Source
Declaration
public string PathBase { get; }

VirtualFiles

View Source
Declaration
public IVirtualFiles VirtualFiles { get; }

VirtualFileSources

View Source
Declaration
public IVirtualPathProvider VirtualFileSources { get; }

Cache

View Source
Declaration
public ICacheClient Cache { get; }

CacheAsync

View Source
Declaration
public ICacheClientAsync CacheAsync { get; }

Db

View Source
Declaration
public IDbConnection Db { get; }

Redis

View Source
Declaration
public IRedisClient Redis { get; }

MessageProducer

View Source
Declaration
public virtual IMessageProducer MessageProducer { get; }

AuthRepository

View Source
Declaration
public IAuthRepository AuthRepository { get; }

AuthRepositoryAsync

View Source
Declaration
public IAuthRepositoryAsync AuthRepositoryAsync { get; }

SessionBag

View Source
Declaration
public virtual ISession SessionBag { get; }

UserSession

View Source
Declaration
protected virtual IAuthSession UserSession { get; }

IsAuthenticated

View Source
Declaration
public bool IsAuthenticated { get; }

SessionKey

View Source
Declaration
public string SessionKey { get; }

IsPostBack

View Source
Declaration
public bool IsPostBack { get; }

DialectProvider

View Source
Declaration
public IOrmLiteDialectProvider DialectProvider { get; }

Inherited Properties

ChildBody

View Source
Declaration
public string ChildBody { get; set; }

ChildPage

View Source
Declaration
public IRazorView ChildPage { get; set; }

Output

View Source
Declaration
public virtual StreamWriter Output { get; set; }

ParentPage

View Source
Declaration
public IRazorView ParentPage { get; set; }

Request

View Source
Declaration
public IRequest Request { get; set; }

Response

View Source
Declaration
public IResponse Response { get; set; }

TypedViewBag

View Source
Declaration
public IViewBag TypedViewBag { get; }

ViewBag

View Source
Declaration
public dynamic ViewBag { get; set; }

Fields

Url

View Source
Declaration
public UrlHelper Url

Methods

SetModel(Object)

View Source
Declaration
public virtual void SetModel(object o)
Parameters
TypeName
System.Objecto

Get<T>()

View Source
Declaration
public virtual T Get<T>()
Returns

<T>

Type Parameters
  • T

GetPlugin<T>()

View Source
Declaration
public virtual T GetPlugin<T>()
where T : class, IPlugin
Returns

<T>

Type Parameters
  • T

TryResolve<T>()

View Source
Declaration
public virtual T TryResolve<T>()
Returns

<T>

Type Parameters
  • T

ResolveService<T>()

View Source
Declaration
public virtual T ResolveService<T>()
Returns

<T>

Type Parameters
  • T

GetSession(Boolean)

View Source
Declaration
public virtual IAuthSession GetSession(bool reload = false)
Returns

ServiceStack.Auth.IAuthSession

Parameters
TypeName
System.Booleanreload

SessionAs<T>()

View Source
Declaration
public virtual T SessionAs<T>()
where T : class, IAuthSession
Returns

<T>

Type Parameters
  • T

ClearSession()

View Source
Declaration
public void ClearSession()

Dispose()

View Source
Declaration
public virtual void Dispose()

Href(String)

View Source
Declaration
public string Href(string url)
Returns

System.String

Parameters
TypeName
System.Stringurl

Prepend(String)

View Source
Declaration
public void Prepend(string contents)
Parameters
TypeName
System.Stringcontents

GetErrorStatus()

View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns

ResponseStatus

GetErrorMessage()

View Source
Declaration
public MvcHtmlString GetErrorMessage()
Returns

ServiceStack.Html.MvcHtmlString

GetAbsoluteUrl(String)

View Source
Declaration
public MvcHtmlString GetAbsoluteUrl(string virtualPath)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.StringvirtualPath

ApplyRequestFilters(Object)

View Source
Declaration
public void ApplyRequestFilters(object requestDto)
Parameters
TypeName
System.ObjectrequestDto

RedirectIfNotAuthenticated(String)

View Source
Declaration
public void RedirectIfNotAuthenticated(string redirectUrl = null)
Parameters
TypeName
System.StringredirectUrl

RedirectToAsync(String)

View Source
Declaration
public async Task RedirectToAsync(string path)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Stringpath

RedirectTo(String)

View Source
Declaration
public MvcHtmlString RedirectTo(string path)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringpath

HasRole(String)

View Source
Declaration
public bool HasRole(string role)
Returns

System.Boolean

Parameters
TypeName
System.Stringrole

HasPermission(String)

View Source
Declaration
public bool HasPermission(string permission)
Returns

System.Boolean

Parameters
TypeName
System.Stringpermission

AssertRole(String, String, String)

View Source
Declaration
public MvcHtmlString AssertRole(string role, string message = null, string redirect = null)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringrole
System.Stringmessage
System.Stringredirect

AssertRoleAsync(String, String, String)

View Source
Declaration
public async Task AssertRoleAsync(string role, string message = null, string redirect = null)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Stringrole
System.Stringmessage
System.Stringredirect

AssertPermission(String, String, String)

View Source
Declaration
public MvcHtmlString AssertPermission(string permission, string message = null, string redirect = null)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringpermission
System.Stringmessage
System.Stringredirect

AssertPermissionAsync(String, String, String)

View Source
Declaration
public async Task AssertPermissionAsync(string permission, string message = null, string redirect = null)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Stringpermission
System.Stringmessage
System.Stringredirect

RenderErrorIfAny()

View Source
Declaration
public bool RenderErrorIfAny()
Returns

System.Boolean

GetErrorHtml()

View Source
Declaration
public MvcHtmlString GetErrorHtml()
Returns

ServiceStack.Html.MvcHtmlString

Inherited Methods

DefaultWriteLiteral(RenderingPage, String)

View Source
Declaration
public static void DefaultWriteLiteral(RenderingPage page, string str)
Parameters
TypeName
ServiceStack.Razor.RenderingPagepage
System.Stringstr

DefaultWriteLiteralTo(RenderingPage, TextWriter, String)

View Source
Declaration
public static void DefaultWriteLiteralTo(RenderingPage page, TextWriter writer, string str)
Parameters
TypeName
ServiceStack.Razor.RenderingPagepage
System.IO.TextWriterwriter
System.Stringstr

DefineSection(String, Action)

View Source
Declaration
public virtual void DefineSection(string sectionName, Action action)
Parameters
TypeName
System.StringsectionName
System.Actionaction

Execute()

View Source
Declaration
public abstract void Execute()

IsSectionDefined(String)

View Source
Declaration
public virtual bool IsSectionDefined(string sectionName)
Returns

System.Boolean

Parameters
TypeName
System.StringsectionName

RenderBody()

View Source
Declaration
public object RenderBody()
Returns

System.Object

RenderChildSection(String, StreamWriter)

View Source
Declaration
public void RenderChildSection(string sectionName, StreamWriter writer)
Parameters
TypeName
System.StringsectionName
System.IO.StreamWriterwriter

RenderSection(String)

View Source
Declaration
public object RenderSection(string sectionName)
Returns

System.Object

Parameters
TypeName
System.StringsectionName

RenderSection(String, Boolean)

View Source
Declaration
public object RenderSection(string sectionName, bool required)
Returns

System.Object

Parameters
TypeName
System.StringsectionName
System.Booleanrequired

SetChildPage(IRazorView, String)

View Source
Declaration
public void SetChildPage(IRazorView childPage, string childBody)
Parameters
TypeName
ServiceStack.Html.IRazorViewchildPage
System.StringchildBody

Write(Object)

View Source
Declaration
public virtual void Write(object obj)
Parameters
TypeName
System.Objectobj

WriteAttribute(String, Tuple<String, Int32>, Tuple<String, Int32>, AttributeValue[])

View Source
Declaration
public virtual void WriteAttribute(string name, Tuple<string, int> prefix, Tuple<string, int> suffix, params AttributeValue[] values)
Parameters
TypeName
System.Stringname
System.Tuple<System.String,System.Int32>prefix
System.Tuple<System.String,System.Int32>suffix
ServiceStack.Razor.AttributeValue[]values

WriteAttributeTo(TextWriter, String, Tuple<String, Int32>, Tuple<String, Int32>, AttributeValue[])

View Source
Declaration
public virtual void WriteAttributeTo(TextWriter writer, string name, Tuple<string, int> prefix, Tuple<string, int> suffix, params AttributeValue[] values)
Parameters
TypeName
System.IO.TextWriterwriter
System.Stringname
System.Tuple<System.String,System.Int32>prefix
System.Tuple<System.String,System.Int32>suffix
ServiceStack.Razor.AttributeValue[]values

WriteLiteral(String)

View Source
Declaration
public virtual void WriteLiteral(string str)
Parameters
TypeName
System.Stringstr

WriteLiteralTo(TextWriter, HelperResult)

View Source
Declaration
public virtual void WriteLiteralTo(TextWriter writer, HelperResult value)
Parameters
TypeName
System.IO.TextWriterwriter
ServiceStack.Html.HelperResultvalue

WriteLiteralTo(TextWriter, String)

View Source
Declaration
public void WriteLiteralTo(TextWriter writer, string literal)
Parameters
TypeName
System.IO.TextWriterwriter
System.Stringliteral

WriteTo(TextWriter, HelperResult)

View Source
Declaration
public virtual void WriteTo(TextWriter writer, HelperResult value)
Parameters
TypeName
System.IO.TextWriterwriter
ServiceStack.Html.HelperResultvalue

WriteTo(TextWriter, Object)

View Source
Declaration
public virtual void WriteTo(TextWriter writer, object obj)
Parameters
TypeName
System.IO.TextWriterwriter
System.Objectobj

Implements